/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.opensource.jdom.taggen.html.tag;

import org.opensource.jdom.taggen.html.CommonAttributes;

/**
 *
 * Defines a form allowing user-inputted data to be sent somewhere. 
 * It is used with elements such as input, select and textarea.
 *
 * <h2>Example</h2> <pre><code class="html">
 *<strong>&lt;form action="/somedirectory/somformprocessingscript.php" method="post"&gt;</strong>
 *	&lt;div&gt;House number: &lt;input type="text" name="housenumber" /&gt;&lt;/div&gt;
 *	&lt;div&gt;Street: &lt;input type="text" name="street" /&gt;&lt;/div&gt;
 *	&lt;div&gt;&lt;input type="submit" /&gt;&lt;/div&gt;
 *<strong>&lt;/form&gt;</strong>
 *</code></pre>
 *
 * @author sergio.valdez
 */
public class Form extends CommonAttributes{

    public static final String POST = "post";
    public static final String GET  = "get";
    public static final String MULTIPART_FORM_DATA   = "multipart/form-data";
    public static final String APP_X_WWW_FORM_URLENC
            = "application/x-www-form-urlencoded";

    /**
     * is used to specify where the form is sent to. It must take the form of 
     * a URI. 
     */
    private String action;
    /**
     * can be used to specify how the form is sent. The value must be get
     * (default), which bolts the form values onto the URI or post which
     * invisibly sends the form data in the body of the HTTP request.
     */
    private String method;
    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded, but this should
     * be multipart/form-data when the form contains a file input element.
     */
    private String enctype;
    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded,
     * but this should be multipart/form-data when the form contains a file
     * input element.
     */
    private String accept;
    /**
     * can be used to specify which character sets should be accepted.
     * This is a comma-separated list.
     */
    private String accept_charset;

    public Form(String action) {
        this.action = action;
    }

    /**
     * is used to specify where the form is sent to. It must take the form of
     * a URI.
     * @return the action
     */
    public String getAction() {
        return action;
    }

    /**
     * is used to specify where the form is sent to. It must take the form of
     * a URI.
     * @param action the action to set
     */
    public void setAction(String action) {
        this.action = action;
    }

    /**
     * can be used to specify how the form is sent. The value must be get
     * (default), which bolts the form values onto the URI or post which
     * invisibly sends the form data in the body of the HTTP request.
     * @return the method
     */
    public String getMethod() {
        return method;
    }

    /**
     * can be used to specify how the form is sent. The value must be get
     * (default), which bolts the form values onto the URI or post which
     * invisibly sends the form data in the body of the HTTP request.
     * @param method the method to set
     */
    public void setMethod(String method) {
        this.method = method;
    }

    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded, but this should
     * be multipart/form-data when the form contains a file input element.
     * @return the enctype
     */
    public String getEnctype() {
        return enctype;
    }

    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded, but this should
     * be multipart/form-data when the form contains a file input element.
     * @param enctype the enctype to set
     */
    public void setEnctype(String enctype) {
        this.enctype = enctype;
    }

    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded,
     * but this should be multipart/form-data when the form contains a file
     * input element.
     * @return the accept
     */
    public String getAccept() {
        return accept;
    }

    /**
     * can be used to specify the MIME type used to encode the form data.
     * The default value is application/x-www-form-urlencoded,
     * but this should be multipart/form-data when the form contains a file
     * input element.
     * @param accept the accept to set
     */
    public void setAccept(String accept) {
        this.accept = accept;
    }

    /**
     * can be used to specify which character sets should be accepted.
     * This is a comma-separated list.
     * @return the accept_charset
     */
    public String getAccept_charset() {
        return accept_charset;
    }

    /**
     * can be used to specify which character sets should be accepted.
     * This is a comma-separated list.
     * @param accept_charset the accept_charset to set
     */
    public void setAccept_charset(String accept_charset) {
        this.accept_charset = accept_charset;
    }

   


}
